Skip to content

feat(pvm): run App Manifest v2 runtimes in Dotli - #185

Open
replghost wants to merge 72 commits into
mainfrom
feat/pvm-wasm
Open

feat(pvm): run App Manifest v2 runtimes in Dotli#185
replghost wants to merge 72 commits into
mainfrom
feat/pvm-wasm

Conversation

@replghost

@replghost replghost commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • run signed PolkaVM App v2 archives with framebuffer, Tri2D, and WebGPU Raster profiles
  • route canonical TrUAPI and optional baseline input through the sandbox
  • keep MotionSample v1 optional and permission-gated, with physical-device and pointer-emulated sources
  • delegate accelerometer and gyroscope Permissions Policy only to verified PolkaVM product iframes
  • request iOS DeviceMotion permission from one top-level Enable motion action, relay origin-gated samples into the product sandbox, and dismiss the prompt after permission is granted
  • recover the trusted parent origin from location.ancestorOrigins when production referrer policy suppresses document.referrer
  • reload only the WebGPU product frame after visibility wake or back-forward-cache restoration, recreating its GPU worker and input listeners while retaining the top-level motion listener
  • size product frames with the dynamic viewport so Android Chrome toolbar changes cannot move content below the visible screen

Verification

  • UI bridge and notification tests: 24 passed, including single-prompt creation, one permission request, automatic dismissal, and physical sample relay
  • product-frame and topbar geometry tests: 16 passed
  • sandbox runtime tests: 31 passed, including wake reload decisions and empty-referrer parent recovery
  • UI and sandbox typecheck, lint, and formatting passed
  • production WebGPU wake recovery recreated the product frame and reached data-pvm-ready=true / data-pvm-gpu=ready
  • Android-sized Chromium geometry used 100dvh; with a 56 px topbar and 24 px bottom inset, the iframe exactly matched the remaining 729 px of an 809 px visible viewport
  • Chinpokomon 0.1.11 loaded from CID bafybeialj2mvzxjaezlqfpk2quvhdm6eyrjns5cvz4dctdm7x4d6tah344

Dependencies

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Performance Report

⚠️ No baseline found on main. This PR's results are recorded but cannot be compared.
Merge to main to establish a baseline.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

Chunks over 500 KB:

File Raw Brotli Gzip
host/assets/paseo.smol-DboPaEh1.json 1.84 MB 941.7 KB 1019.4 KB
host/assets/paseo-people-next.smol.json 3.36 MB 1.68 MB 1.82 MB
host/assets/smoldot.js 3.05 MB 2.27 MB (+315 B) 2.28 MB
host/assets/smoldot_worker.js 3.02 MB 2.26 MB 2.27 MB
host/assets/truapi_server_bg.wasm 7.20 MB 5.29 MB 5.56 MB
host/assets/wasm/web/truapi_server_bg.wasm 7.20 MB 5.29 MB 5.56 MB
sandbox/pvm-runtime/pvm-browser-runtime.wasm 1006.9 KB 167.5 KB 226.6 KB
Total 28.03 MB (+1.22 MB) 18.29 MB (+239.2 KB) (-35%) 19.19 MB (+304.9 KB)
All files
File Raw Brotli Gzip
host/.well-known/apple-app-site-association 505 B 505 B 505 B
host/.well-known/assetlinks.json 2.1 KB 343 B 427 B
host/assets/bridge.js 74.0 KB (+3.5 KB) 20.3 KB (+1.0 KB) 23.3 KB (+1.1 KB)
host/assets/browser.js 22.9 KB 7.6 KB (+13 B) 8.6 KB (-1 B)
host/assets/client.js 100.1 KB 29.4 KB (+17 B) 32.4 KB (+5 B)
host/assets/dist.js 39.0 KB (+6 B) 12.8 KB (-44 B) 14.5 KB (+42 B)
host/assets/dotli-debug-bus.js 710 B 710 B 710 B
host/assets/get-sync-provider.js 2.8 KB 1.1 KB (-3 B) 1.2 KB (-2 B)
host/assets/hex.js 154 B 154 B 154 B
host/assets/index.js 234.7 KB (+6.3 KB) 58.7 KB (+1.5 KB) 70.3 KB (+2.0 KB)
host/assets/index.css 55.1 KB 8.6 KB 9.8 KB
host/assets/manifest.js 19.6 KB (-3.0 KB) 6.5 KB (-738 B) 7.2 KB (-819 B)
host/assets/panel.js 76.4 KB (+128 B) 20.6 KB (+38 B) 23.2 KB (+3 B)
host/assets/paseo.smol-DboPaEh1.json 1.84 MB 941.7 KB 1019.4 KB
host/assets/paseo-people-next.smol.json 3.36 MB 1.68 MB 1.82 MB
host/assets/paseo.smol.json 25.2 KB 5.6 KB 6.7 KB
host/assets/previewnet.smol.json 63.7 KB 7.6 KB 13.1 KB
host/assets/resolve.js 156 B 156 B 156 B
host/assets/rpc-resolve.js 2.5 KB 1.0 KB (+3 B) 1.2 KB (+1 B)
host/assets/smoldot.js 3.05 MB 2.27 MB (+315 B) 2.28 MB
host/assets/smoldot_worker.js 3.02 MB 2.26 MB 2.27 MB
host/assets/spans.js 2.6 KB 1.1 KB 1.3 KB
host/assets/src.js 1.8 KB 855 B (+11 B) 947 B (+2 B)
host/assets/styles.css 15.3 KB 3.3 KB 3.8 KB
host/assets/truapi_server_bg.wasm 7.20 MB 5.29 MB 5.56 MB
host/assets/wasm/web/README.md 13.4 KB 13.4 KB 13.4 KB
host/assets/wasm/web/package.json 371 B 371 B 371 B
host/assets/wasm/web/truapi_server.d.ts 12.6 KB 12.6 KB 12.6 KB
host/assets/wasm/web/truapi_server.js 49.7 KB 7.9 KB 9.2 KB
host/assets/wasm/web/truapi_server_bg.wasm 7.20 MB 5.29 MB 5.56 MB
host/assets/wasm/web/truapi_server_bg.wasm.d.ts 4.0 KB 4.0 KB 4.0 KB
host/assets/web.js 18.2 KB (+6 B) 4.6 KB (-9 B) 5.1 KB (-4 B)
host/assets/worker-runtime.js 28.9 KB (+28.8 KB) 6.8 KB (+6.7 KB) 7.7 KB (+7.6 KB)
host/assets/worker-runtime.js 106 B 106 B 106 B
host/assets/ws.js 23.1 KB 7.5 KB (-5 B) 8.2 KB (+2 B)
host/dotli.png 11.5 KB 11.5 KB 11.5 KB
host/favicon.svg 1.8 KB 1.8 KB 1.8 KB
host/host-sw.js 2.7 KB 1.1 KB (-7 B) 1.3 KB (-7 B)
host/icon-192.png 12.5 KB 12.5 KB 12.5 KB
host/icon-512.png 42.8 KB 42.8 KB 42.8 KB
host/index.html 29.1 KB 5.4 KB (-5 B) 6.7 KB (-2 B)
host/manifest.webmanifest 441 B 441 B 441 B
host/workbox.js 14.8 KB 4.6 KB 5.1 KB
sandbox/app-sw.js 9.7 KB (+52 B) 3.2 KB (+21 B) 3.6 KB (+18 B)
sandbox/assets/bitswap-bridge.js 840 B 840 B 840 B
sandbox/assets/fetch.js 3.4 KB 1.2 KB (+1 B) 1.4 KB (+2 B)
sandbox/assets/index.css 55.1 KB 8.6 KB 9.8 KB
sandbox/assets/index.js 163.5 KB (+43.0 KB) 46.6 KB (+12.2 KB) 54.4 KB (+14.1 KB)
sandbox/favicon.svg 1.8 KB 1.8 KB 1.8 KB
sandbox/index.html 1.7 KB 583 B (+3 B) 786 B
sandbox/pvm-runtime/LICENSE-MPL-2.0 16.3 KB 16.3 KB 16.3 KB
sandbox/pvm-runtime/PolkaVM-LICENSE-APACHE 10.6 KB 10.6 KB 10.6 KB
sandbox/pvm-runtime/PolkaVM-LICENSE-MIT 1023 B 1023 B 1023 B
sandbox/pvm-runtime/SOURCE 389 B 389 B 389 B
sandbox/pvm-runtime/pvm-browser-runtime.wasm 1006.9 KB 167.5 KB 226.6 KB
sandbox/pvm-runtime/pvm-gpu-worker.js 61.0 KB 10.3 KB 11.8 KB
sandbox/pvm-runtime/pvm-wasm-worker.js 74.8 KB 12.1 KB 14.2 KB
Total 28.03 MB (+1.22 MB) 18.29 MB (+239.2 KB) (-35%) 19.19 MB (+304.9 KB)

Commit: a72f59d

@replghost

replghost commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@justraman the PVM change is green across formatting, build, unit, functional, and the canonical seven-app Dotli matrix. The broad host-playground E2E remains red on the same account, allowance, and navigation failures as current main (the latest main Tests runs also fail); it does not exercise this PVM path. Could you review the runtime adapter so this can follow host-rust-core#540?

@replghost

Copy link
Copy Markdown
Collaborator Author

Revended reviewed host-rust-core commit 56c67a306fc276129829f94db85a622061e17882. Re-ran the canonical matrix on this exact vendor: Doom, Quake, Duke3D, NES, egui kitchen sink, GPU Cube, and Scene Lab all passed through Dotli's compiler backend.

@replghost

Copy link
Copy Markdown
Collaborator Author

CI diagnosis: the red E2E job is not specific to this branch.

  • main has the same host-playground product-account failures in runs 33158665346 and 33112105412.
  • I reran this PR's failed jobs as attempt 2 of 33206120102; pairing and product loading succeeded, then accounts-provider-product remained pending and the dependent TrUAPI cases cascaded.
  • Unit, Functional, bundle, lint, and the independent seven-app PolkaVM browser matrix pass.

No Dotli source change is justified for this shared signer/product-account path; the check needs the external E2E dependency restored or the repository's existing external-outage policy applied.

@replghost

Copy link
Copy Markdown
Collaborator Author

westendli.dev deployment 33225654653 completed successfully for f1c2e68, but live verification is blocked by stale environment infrastructure:

  • westendli.dev and wildcard subdomains resolve to 151.115.144.84.
  • Ports 80 and 443 on that address are unreachable.
  • The other staging domains resolve to the current shared staging host 51.159.177.252.
  • The repository Makefile declares every non-production environment, including dev-westend, on the shared staging box.

Repair requires provisioning the westendli.dev, *.westendli.dev, and *.app.westendli.dev nginx/certificate configuration on the current staging host and updating the Cloudflare DNS records. The build artifacts are already deployed; no Duke republish is needed.

@replghost

Copy link
Copy Markdown
Collaborator Author

Live PVM acceptance on westendli.dev — the missing proof

The earlier note on this PR was that the E2E product suite skipped (Nova signing bot unavailable), so live DotLi PolkaVM acceptance stayed unproven. It is proven now, against the deployed westendli.dev host, for two independently published products.

Deploy run 33775043152 from this branch's head shipped all three builds — host 8.3 MB, sandbox 1.2 MB (contains /pvm-runtime/), protocol — and the runtime assets serve:

asset status size
pvm-wasm-worker.js 200 70,676 B
pvm-browser-runtime.wasm 200 application/wasm 977,926 B

Resolution chain, end to end

Host resolved the DotNS label, threaded the CID through the URL contract, and mounted the sandbox with the v=4 executable-manifest contract (the older failure was v=3 without it):

  • responsive-egui00.paseobafybeiawkfp3wps7azyww6omgfjphxuwu3w7do2aafy2xtylno45gwyfqi
  • responsive-egui.paseobafybeidldnath3lzdste4h3b5rqckvorsmkuvmejnfr4wmzkga77tz5kte

Both on network=paseo-next-v2, profile=tri2d, pointer + keyboard in requiredFeatures.

Runtime metrics

product backend ready fps draws vertices first frame
responsive-egui00 compiler (JIT) true 60.1 8 2232 1035.8 ms
responsive-egui compiler (JIT) true 60.1 8 2232 1154 ms

Steady state measured by frame delta, not the reported counter: 304 frames in 5 s = 60.8 fps. Translation 176–187 ms.

Responsive contract holds under resize

Three breakpoints against the live host, no runtime restart, pvmReady stayed true across all resizes:

breakpoint viewport canvas fps vertices
wide 1000x800 1000x744 61.4 2232
medium 760x800 760x744 60.4 2096
compact 420x800 420x744 61.4 1828

Vertex count shifts per breakpoint, so the guest genuinely re-lays-out rather than scaling one fixed scene. Medium's 2096 matches the Epoca figure exactly — same artifact, two independent hosts.

Local suites on the rebased head: 27/27 sandbox, 2/2 PVM functional (1 skipped, needs CAR fixture paths).

This PR is MERGEABLE with all checks green and remains blocked only on REVIEW_REQUIRED, since I pushed the rebase and cannot self-approve.

@replghost

Copy link
Copy Markdown
Collaborator Author

Updated to host-rust-core #540 head 85effb1b05cdfefa1e48ba3b2da4fb58684cd780 and pvm-host-runtime v0.1.8 at 530885a9d6dbf5a2742d4f2ff9f5c71b05f2a762. All required checks, functional coverage, E2E, and westendli.dev deployment are green. Normal merge is blocked only by the required review policy; auto-merge is disabled for this repository. Ready for maintainer approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant